<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="css/jquery.mobile-1.4.2.min.css" />
<link rel="stylesheet" type="text/css" href="css/mobiscrollcss/mobiscroll.custom-2.6.2.min.css">
<link rel="stylesheet" type="text/css" href="css/salecss.css">

<script type="text/javascript" src="js/lib/jquery-2.1.1.min.js"></script>
<script src="js/mobiscroll.custom-2.6.2.min.js"></script>
<script type="text/javascript" src="js/JKLogin.js"></script>
<script type="text/javascript" src="js/JKCheckForm.js"></script>
<script type="text/javascript" src="js/JKFunc.js"></script>
<script type="text/javascript" src="js/JKRegister.js"></script>
<script type="text/javascript" src="js/lib/jquery.mobile-1.4.2.min.js"></script>
<script type="text/javascript">
window.onload = function(){
var isAutoLogin =  "false";
isAutoLogin = localStorage.getItem("isAutoLogin");
if(isAutoLogin=="true"){
	var saleAdminId = localStorage.getItem("saleAdminId");
	if(saleAdminId!=null){
		window.location.href="main.html";
	}
	}



}
</script>
</head>

<body>
<div data-role="page" id="page_2" data-theme="jk">
<div data-role="header">
    <h1>登录</h1>
  </div>
  <div data-role="content">
  <div class="ui-field-contain">
    		<label for="phone_number2">手机号：</label>
    		<input type="text" name="phone_number2" id="phone_number2" placeholder="手机号" value="" style="background-color:#FFFFFF">
		</div>
        <div class="ui-field-contain">
    		<label for="password2">密码：</label>
    		<input type="password" name="password2" id="password2" placeholder="密码" value="" style="background-color:#FFFFFF">
		</div>
        <div>
            <input type="checkbox" name="auto2" id="auto2" onClick="setAutoLogin()">
            <label for="auto2" style=" background-color:#f08200">自动登录</label>
        </div>

   <p align="center"> <a class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini" style=" background-color:#f08200; color:#FFFFFF" rel="external" onClick="login()">登录</a></p>

    

  </div>
</div>


<script type="text/javascript">
function setAutoLogin(){
	if($("#auto2").attr("data-cacheval")=="true"){
    localStorage.setItem("isAutoLogin", false);
	}else{
	localStorage.setItem("isAutoLogin", true);
}
}
function login(){
	if($("#phone_number2").val()=="" || $("#password2").val()=="") {
				alert("手机号或密码不能为空！");
				return;
			} else if( JKCheckMobile($("#phone_number2")) &&　JKCheckPasswordLogin($("#password2")) ){
				var pn = $("#phone_number2").val();
				var pw = $("#password2").val();
				JKSalesLogin(pn, pw);//方法在JKLogin.js中
				}
	}
</script>
  
   
</body>
</html>
